document.addEventListener('keydown', function (event) {
    if(event.code === 'Left' || event.code === 'ArrowLeft' || event.code === 'Up' || event.code === 'ArrowUp') {
        let previous_link = document.getElementById('previous-link');
        if(previous_link !== null) {
            window.location.href = previous_link.getAttribute('href');
        }
    }
    else if(event.code==='Right' || event.code === 'ArrowRight' || event.code === 'Down' || event.code === 'ArrowDown') {
        let next_link = document.getElementById('next-link');
        if(next_link !== null) {
            window.location.href = next_link.getAttribute('href');
        }
    }
})